package com.jianganming.observer.demo3;

public class Test {
    public static void main(String[] args) {
        Teacher teacher = new Teacher("张老师","同学们开始上课了");

        Student student = new Student("小明");
        Student student1 = new Student("小华");
        Student student2 = new Student("小兰");

        teacher.addObserver(student);
        teacher.addObserver(student1);
        teacher.addObserver(student2);

        teacher.change();
        teacher.notifyObservers();
    }
}
